/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.List;
import util.enumeration.IndustryType;

/**
 *
 * @author Koh Li
 */
@Entity
public class IndustryTypeEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long industryTypeId;
    private IndustryType industryType;
    
    @OneToMany(mappedBy="industry")
    private List<StakeholderEntity> stakeholder = new ArrayList<StakeholderEntity>();
    
    
    public IndustryTypeEntity() {
        
    }

    public Long getIndustryTypeId() {
        return industryTypeId;
    }

    public void setIndustryTypeId(Long industryTypeId) {
        this.industryTypeId = industryTypeId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (industryTypeId != null ? industryTypeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the industryTypeId fields are not set
        if (!(object instanceof IndustryTypeEntity)) {
            return false;
        }
        IndustryTypeEntity other = (IndustryTypeEntity) object;
        if ((this.industryTypeId == null && other.industryTypeId != null) || (this.industryTypeId != null && !this.industryTypeId.equals(other.industryTypeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.IndustryTypeEntity[ industryTypeId=" + industryTypeId + " ]";
    }

    public IndustryType getIndustryType() {
        return industryType;
    }

    public void setIndustryType(IndustryType industryType) {
        this.industryType = industryType;
    }

    public List<StakeholderEntity> getStakeholder() {
        return stakeholder;
    }

    public void setStakeholder(List<StakeholderEntity> stakeholder) {
        this.stakeholder = stakeholder;
    }
    
}